#include <iostream>

using namespace std;
const int N = 50;
int arr[N];
using ll = long long;
int main()
{
    string s = "2021ABCD";
    //将字符串存到数组中
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] >= '0' && s[i] <= '9')
            arr[i + 1] = s[i] - '0';
        else
            arr[i + 1] = s[i] - 'A' + 10;
    }
    //转化为10进制的模板
    ll x = 0;
    for (int i = 1; i <= s.length(); i++)
    {
        x = x * 16 + arr[i];
    }
    cout << x << endl;
    return 0;
}
